home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / PictUtils.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  4.9 KB  |  175 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        PictUtils.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__PICTUTILS__') = 'UNDEFINED' THEN
  18. __PICTUTILS__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  27.     include 'Windows.a'
  28.     ENDIF
  29. ;        include 'Memory.a'                                            ;
  30. ;            include 'MixedMode.a'                                    ;
  31. ;        include 'Quickdraw.a'                                        ;
  32. ;            include 'QuickdrawText.a'                                ;
  33. ;        include 'Events.a'                                            ;
  34. ;            include 'OSUtils.a'                                    ;
  35. ;        include 'Controls.a'                                        ;
  36. ;            include 'Menus.a'                                        ;
  37.  
  38.     IF &TYPE('__PALETTES__') = 'UNDEFINED' THEN
  39.     include 'Palettes.a'
  40.     ENDIF
  41.  
  42. returnColorTable                EQU        $0001
  43. returnPalette                    EQU        $0002
  44. recordComments                    EQU        $0004
  45. recordFontInfo                    EQU        $0008
  46. suppressBlackAndWhite            EQU        $0010
  47.  
  48. ; color pick methods 
  49. systemMethod                    EQU        0                    ; system color pick method 
  50. popularMethod                    EQU        1                    ; method that chooses the most popular set of colors 
  51. medianMethod                    EQU        2                    ; method that chooses a good average mix of colors 
  52. ; color bank types 
  53. ColorBankIsCustom                EQU        -1
  54. ColorBankIsExactAnd555            EQU        0
  55. ColorBankIs555                    EQU        1
  56.  
  57. CommentSpec             RECORD    0
  58. count                     ds.w    1                                    ; number of occurrances of this comment ID 
  59. ID                         ds.w    1                                    ; ID for the comment in the picture 
  60. sizeof                     EQU    4
  61.                         ENDR
  62.  
  63. FontSpec                 RECORD    0
  64. pictFontID                 ds.w    1                                    ; ID of the font in the picture 
  65. sysFontID                 ds.w    1                                    ; ID of the same font in the current system file 
  66. size                     ds.l    4                                    ; bit array of all the sizes found (1..127) (bit 0 means > 127) 
  67. style                     ds.w    1                                    ; combined style of all occurrances of the font 
  68. nameOffset                 ds.l    1                                    ; offset into the fontNamesHdl handle for the font’s name 
  69. sizeof                     EQU    26
  70.                         ENDR
  71.  
  72. PictInfo                 RECORD    0
  73. version                     ds.w    1                                    ; this is always zero, for now 
  74. uniqueColors             ds.l    1                                    ; the number of actual colors in the picture(s)/pixmap(s) 
  75. thePalette                 ds.l    1                                    ; handle to the palette information 
  76. theColorTable             ds.l    1                                    ; handle to the color table 
  77. hRes                     ds.l    1                                    ; maximum horizontal resolution for all the pixmaps 
  78. vRes                     ds.l    1                                    ; maximum vertical resolution for all the pixmaps 
  79. depth                     ds.w    1                                    ; maximum depth for all the pixmaps (in the picture) 
  80. sourceRect                 ds        Rect                                ; the picture frame rectangle (this contains the entire picture) 
  81. textCount                 ds.l    1                                    ; total number of text strings in the picture 
  82. lineCount                 ds.l    1                                    ; total number of lines in the picture 
  83. rectCount                 ds.l    1                                    ; total number of rectangles in the picture 
  84. rRectCount                 ds.l    1                                    ; total number of round rectangles in the picture 
  85. ovalCount                 ds.l    1                                    ; total number of ovals in the picture 
  86. arcCount                 ds.l    1                                    ; total number of arcs in the picture 
  87. polyCount                 ds.l    1                                    ; total number of polygons in the picture 
  88. regionCount                 ds.l    1                                    ; total number of regions in the picture 
  89. bitMapCount                 ds.l    1                                    ; total number of bitmaps in the picture 
  90. pixMapCount                 ds.l    1                                    ; total number of pixmaps in the picture 
  91. commentCount             ds.l    1                                    ; total number of comments in the picture 
  92. uniqueComments             ds.l    1                                    ; the number of unique comments in the picture 
  93. commentHandle             ds.l    1                                    ; handle to all the comment information 
  94. uniqueFonts                 ds.l    1                                    ; the number of unique fonts in the picture 
  95. fontHandle                 ds.l    1                                    ; handle to the FontSpec information 
  96. fontNamesHandle             ds.l    1                                    ; handle to the font names 
  97. reserved1                 ds.l    1
  98. reserved2                 ds.l    1
  99. sizeof                     EQU    104
  100.                         ENDR
  101.  
  102.     IF GENERATING68K THEN
  103.         Macro
  104.         _GetPictInfo
  105.             move.w    #$0800,d0
  106.             dc.w     $A831
  107.         EndM
  108.     ELSE
  109.         IMPORT    GetPictInfo
  110.     ENDIF
  111.  
  112.     IF GENERATING68K THEN
  113.         Macro
  114.         _GetPixMapInfo
  115.             move.w    #$0801,d0
  116.             dc.w     $A831
  117.         EndM
  118.     ELSE
  119.         IMPORT    GetPixMapInfo
  120.     ENDIF
  121.  
  122.     IF GENERATING68K THEN
  123.         Macro
  124.         _NewPictInfo
  125.             move.w    #$0602,d0
  126.             dc.w     $A831
  127.         EndM
  128.     ELSE
  129.         IMPORT    NewPictInfo
  130.     ENDIF
  131.  
  132.     IF GENERATING68K THEN
  133.         Macro
  134.         _RecordPictInfo
  135.             move.w    #$0403,d0
  136.             dc.w     $A831
  137.         EndM
  138.     ELSE
  139.         IMPORT    RecordPictInfo
  140.     ENDIF
  141.  
  142.     IF GENERATING68K THEN
  143.         Macro
  144.         _RecordPixMapInfo
  145.             move.w    #$0404,d0
  146.             dc.w     $A831
  147.         EndM
  148.     ELSE
  149.         IMPORT    RecordPixMapInfo
  150.     ENDIF
  151.  
  152.     IF GENERATING68K THEN
  153.         Macro
  154.         _RetrievePictInfo
  155.             move.w    #$0505,d0
  156.             dc.w     $A831
  157.         EndM
  158.     ELSE
  159.         IMPORT    RetrievePictInfo
  160.     ENDIF
  161.  
  162.     IF GENERATING68K THEN
  163.         Macro
  164.         _DisposePictInfo
  165.             move.w    #$0206,d0
  166.             dc.w     $A831
  167.         EndM
  168.     ELSE
  169.         IMPORT    DisposePictInfo
  170.     ENDIF
  171.  
  172.     IF OLDROUTINENAMES  THEN
  173.     ENDIF
  174.     ENDIF ; __PICTUTILS__
  175.